<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/inc/sessionCheck.jsp" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet" type="text/css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
		<script language="javascript" src="<%=path%>/js/frame.js"></script>
		<style type="text/css">
			table.simple thead tr th {
				background-color: #EEF1FB;
			}
			
			table.simple tr.even {
				background-color: #fff;
			}
			
			table.simple {
				border: 1px solid #BAC8EF;
				border-collapse: collapse;
			}
			
			table.simple td,table.simple th {
				border: 1px solid #BAC8EF;
			}
			
			.pagelinks{
				width: 100%;
				display: block;
				border-top: none;
				margin-bottom: -5px;
				text-align:right;
				margin:0 auto;
				font-size: 12px;
			}
		</style>
	</head>
	<body>
	 <html:form styleId="projectworksheetsForm"
			action="getProjectworksheetsList.do?method=findProjectworksheetsPartialList">
		<table cellspacing="0" cellpadding="0" width="98%" align="center"  border="0" class="margtb5">
		    <tr>
		      <td align="left" class="padl5 lan12"><img src="<%=path%>/images/img-11.gif" width="12" height="12">&nbsp;项目管理 &gt; 立项管理 &gt; 开发任务书</td>
		    </tr>
		</table>
			<table cellspacing="3" cellpadding="0" width="98%" align="center"  border="0" class="kuang2 margtb5 hei12">
  <tr>
	  <td width="12%" align="right">任务书编号：</td>
	  <td width="21%"><html:text property="projectid" /></td>
	  <td width="11%" align="right">项目名称：</td>
	  <td width="21%"><html:text property="projectname" /></td>
	  <td width="14%" align="right">承 担 单 位 ：</td>
	  <td width="21%"><html:text property="undertakedepar" /></td>
  </tr>
    <tr>
	  <td align="right">项目负责人：</td>
	  <td><html:text property="principal" /></td>
	  <td align="right">审批状态：</td>
	  <td><ssh:select propertyName="state" pid="examine_state" type="1" defaultName="${projectworksheetsForm.state}"/></td>
	  <td align="right">项目所属年度：</td>
	  <td>
	     <html:select property="year">
									  <option value="">----请选择----</option>
	                      	 <c:forEach var="i" begin="2005" end="2050" step="1"> 
	                      	       
                                   <c:if test="${projectworksheetsForm.year==i }">
                                   		<option value="<c:out value="${i}" />" selected>${i}</option>
                                   </c:if>
                                   <c:if test="${projectworksheetsForm.year!=i }">
                                   		<option value="<c:out value="${i}" />" >${i}</option>
                                   </c:if>
                               </c:forEach>
                               </html:select>
      </td>
	</tr>
	<tr>
	  <td align="right">项目类别：</td>
	  <td colspan="3"><ssh:select propertyName="projectCategory" pid="project_category" type="1" defaultName="${projectworksheetsForm.projectCategory}"/>  </td>
	  <td align="right" class="padr10"><input id="Submit_Add22" type="button" value="查询" onClick="query();" name="Submit_Add22" class="buttonbg"/></td>
	  <td>&nbsp;</td>
  </tr>
</table>


<table cellspacing="0" cellpadding="0" width="98%" align="center"  border="0" class="margb5">
  <tr>
    <td colspan="8" class="bgcolor2 padlr5">
    		<table border="0" cellspacing="0" cellpadding="0" class="lan13b">
				<tr>
					<td width="20">
						<img src="<%=applicationPath%>/images/tianjia.gif"
							alt="<bean:message key='com.syc.common.projectworksheets.add'  bundle="projectworksheets"/>"
							height="15" width="15" />
					</td>
					<td width="35">
						<a href="#" onClick="addProjectworksheets();"><bean:message
								key='com.syc.common.projectworksheets.add' bundle="projectworksheets" /> </a>
					</td>

					<td width="20">
						<img src="<%=applicationPath%>/images/bianji.gif"
							alt="<bean:message key='com.syc.common.projectworksheets.modify'  bundle="projectworksheets"/>"
							height="15" width="15" />
					</td>
					<td width="35">
						<html:link href="" onclick="return hasSelects('one','selectId','editId','toUpdateProjectworksheets.do?method=toUpdateProjectworksheets','','edit')" styleId="editId">
							<bean:message
								key='com.syc.common.projectworksheets.modify' bundle="projectworksheets" />
						</html:link>
					</td>

					<td width="25" align="center">
						<img src="<%=applicationPath%>/images/shanchu.gif"
							alt="<bean:message key='com.syc.common.projectworksheets.del'  bundle="projectworksheets"/>"
							height="15" width="15" />
					</td>
					<td class="lieb-zi" width="35">
						<html:link href="" onclick="return hasSelects('one','selectId','delId','deleteProjectworksheets.do?method=deleteProjectworksheets','','del')" styleId="delId">
							<bean:message
								key='com.syc.common.projectworksheets.del' bundle="projectworksheets" />
						</html:link>
					</td>


					<td width="20">
						<img src="${pageContext.request.contextPath}/images/chakan.gif"
							alt="<bean:message key='com.syc.common.projectworksheets.view'  bundle="projectworksheets"/>"
							height="15" width="15" />
					</td>
					<td width="35">
							<html:link href="" onclick="return hasSelects('one','selectId','showId','viewProjectworksheets.do?method=viewProjectworksheets','','')" styleId="showId">
								<bean:message key='com.syc.common.projectworksheets.view' bundle="projectworksheets" />
							</html:link>
					</td>
					
					
					<td width="25" align="center">
						<img src="<%=applicationPath%>/images/shangbao.gif"
							alt="<bean:message key='com.syc.common.projectworksheets.view'  bundle="projectworksheets"/>"
							height="15" width="15" />
					</td>
					<td width="65" class="lieb-zi">
				    <html:link href=""  onclick="return tijiao('one','selectId','tijiaoId','projectworksheets/startFolw.do?method=startFlow','','tijiao')"  styleId="tijiaoId">
						 提交审核
					  </html:link>
					</td>
				  </tr>
			</table>
		</td>
	</tr>
				<tr>
					<td>
						<fmt:bundle
							basename="com.application.projectworksheets.struts.ApplicationResources_projectworksheets">
							<display:table name="projectworksheetsList" class="simple"
								id="projectworksheets" pagesize="10" partialList="true"
								 defaultorder="descending" size="resultSize"
								requestURI="getProjectworksheetsList.do?method=findProjectworksheetsPartialList">
								
    							<display:column title="选择"
									sortable="false" 
									style=" width:5%; text-align:center;">
							     <c:out value="<input type='Checkbox'  name='selectId' value='${projectworksheets.id},${projectworksheets.principalid},${projectworksheets.state}'/>" escapeXml="false"/>
							    </display:column>

                          <display:column property="projectid"  style=" width:7%; text-align:center;"
									titleKey="com.application.projectworksheets.entity.projectworksheets.createpage.projectid"
									sortable="true"/>    
             <display:column titleKey="com.application.projectworksheets.entity.projectworksheets.createpage.projectname" sortable="true" style="width:17%; text-align:center;">
                   <a onclick="viewProjectworksheets('${projectworksheets.id}');" href="#" >${projectworksheets.projectname}</a> 
              </display:column>
                                
						


								<display:column property="bak3"  style=" width:10%; text-align:center; "
									titleKey="com.application.projectworksheets.entity.projectworksheets.listpage.projectCategory"
									sortable="true" dictCode="project_category" decorator="com.sync.commons.DictCodeColumnDecorator"/>
								<display:column property="principal"  style=" width:7%; text-align:center; "
									titleKey="com.application.projectworksheets.entity.projectworksheets.createpage.authority"
									sortable="true"/>
							     <display:column property="year"  style=" width:5%; text-align:center;"
									titleKey="com.application.projectworksheets.entity.projectworksheets.listpage.year"
									sortable="true"/>
									<display:column property="ifoutsourcing"  style=" width:5%; text-align:center; "
									titleKey="com.application.projectworksheets.entity.projectworksheets.listpage.ifOutSourcing"
									sortable="true" dictCode="yes_no" decorator="com.sync.commons.DictCodeColumnDecorator"/>
								<display:column property="undertakedepar"  style=" width:5%; text-align:center;"
									titleKey="com.application.projectworksheets.entity.projectworksheets.listpage.undertakedepar"
									sortable="true"/>
									
								<display:column property="state"  style=" width:5%; text-align:center;"
									titleKey="com.application.projectrfps.entity.projectworksheets.listpage.state" 
									sortable="true" headerClass="ctitle" decorator="com.sync.commons.DictCodeColumnDecorator" dictCode="examine_state"/>	
								
								<display:column title="流程查看" style=" width:3%; text-align: center;">
									<c:choose>
										<c:when test="${projectworksheets.state!=42001}">
											<a href="${pageContext.request.contextPath}/frame/systemFun/monitor/OaProcessInsDyView_jpg.jsp?processInsId=${projectworksheets.procid}&userName=${sessionScope.user.username}" target='_blank'>
												<img src="${pageContext.request.contextPath}/images/015.gif" border="0" alt="查看">
											</a>				
										</c:when>
										<c:otherwise>
												<img src="${pageContext.request.contextPath}/images/013.gif" border="0" alt="不可查看">
										</c:otherwise>
									</c:choose>
								</display:column>									
							</display:table>
						</fmt:bundle>
					</td>
				</tr>
			</table>
			<input type="hidden" id="totalPage" value="${totalPage}"/>	     
		</html:form>
	</body>
</html>
<script>

function query(){
	document.forms[0].action="getProjectworksheetsList.do?method=findProjectworksheetsPartialList";
	document.forms[0].submit();
}

//新增
function addProjectworksheets(){
    document.forms[0].action="toAddProjectworksheets.do?method=toAddProjectworksheets";
	document.forms[0].submit();
}




	
	
function validateSelect(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	count++;
		}
	}
    return count;
}




//全选   
function checkAll()   
{ 
  
   var chk=document.getElementsByName("selectId");   
   for(var i=0;i<chk.length;i++)   
   { 
     if($('checkall').checked){
     	chk(i).checked=true; 
     }else{
        chk(i).checked=false; 
     } 
       
 }
  
}   

function viewProjectworksheets(id){
   document.forms[0].action="viewProjectworksheets.do?method=viewProjectworksheets&id=" + id;
   document.forms[0].submit();
}

</script>
